﻿<%@ Page Title="Xem nội dung - Mailbox" EnableEventValidation="false" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="MailBox.Details" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <div id="menu_top" class="col-md-12 col-xs-12 col-lg-12 col-sm-12 noprint" style="padding: 0px; border-bottom: 1px solid #ddd;">
        <div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
            <span class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" id="btnBack" title="Quay về danh sách mails">
                <span class="fa fa-mail-reply"></span>
            </span>
        </div>
        <%--<div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
            <span class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" title="Làm mới mails hiện hành">
                <span class="fa fa-refresh"></span>
            </span>
        </div>--%>
        <div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
            <span class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" id="btnDetail_Del" title="Xóa nội dung">
                <span class="fa fa-trash-o"></span>
            </span>
        </div>
        <div class="visible-xs pull-right" style="padding: 10px 10px 10px 0px; width: auto; float: left;">
            <span class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Cũ hơn" style="border-radius: 0px;">
                <i class="fa fa-caret-right"></i>
            </span>
        </div>
        <div class="visible-xs pull-right" style="padding: 10px 10px 10px 0px; width: auto; float: left;">
            <span class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Mới hơn" style="border-radius: 0px; margin-right: 10px;">
                <i class="fa fa-caret-left"></i>
            </span>
        </div>
        <%--<div class="pull-right" style="padding: 10px 0px 10px 0px; text-align: right;">
            <label style="margin-right: 20px; font-size: 13px;">1 - 50 trên tổng 142</label>
            <span class="btn btn-default hidden-xs" data-toggle="tooltip" data-placement="bottom" title="Mới hơn" style="border-radius: 0px; margin-right: 20px;">
                <i class="fa fa-caret-left"></i>
            </span>
            <span class="btn btn-default hidden-xs" data-toggle="tooltip" data-placement="bottom" title="Cũ hơn" style="border-radius: 0px;">
                <i class="fa fa-caret-right"></i>
            </span>
        </div>--%>
    </div>
    <!-- Danh sách mail -->
    <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 0px;">

        <!-- Mail UNREAD -->
        <div id="detail_mail_1" class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 0px;">
            <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 0px; background: #eee; border-bottom: 1px solid #ddd;">
                <div class="col-xs-8 col-sm-8 col-md-11 col-lg-11" style="padding: 10px 10px 10px 10px; overflow: hidden">
                    <div class="title_over" style="line-height: 27px; font-weight: bold; font-size: 18px;">
                        <asp:Label runat="server" ID="lblTitle"></asp:Label>
                    </div>
                </div>
                <div class="col-xs-4 col-sm-4 col-lg-1 col-md-1 noprint" style="padding: 5px 10px; text-align: center;">
                    <span class="btn btn-default" onclick="printDiv()" style="border-radius: 0px; width: auto; padding: 7px 12px;" data-toggle="tooltip" data-placement="bottom" title="In">
                        <span class="fa fa-print"></span>
                    </span>
                </div>

            </div>
            <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 10px 0px; border-bottom: 1px solid #ddd; border-radius: 0px;">
                <div class="col-md-1 col-lg-1 col-sm-3 col-xs-3 noprint" style="padding: 0px; text-align: center">
                    <div class="title_over" style="line-height: 37px; font-weight: bold; font-size: 18px;">
                        <img runat="server" id="detail_sender_avatar" class="img img-thumbnail"  style="width: 50px;" />
                    </div>
                </div>
                <div class="col-md-7 col-xs-10 col-lg-7 col-sm-10" style="padding: 5px 5px;">
                    <b>
                        <asp:Label runat="server" ID="lblSenderName"></asp:Label></b>
                    <asp:Label runat="server" ID="lblReciever"></asp:Label>
                    ,<span class="fa fa-users" data-toggle="tooltip" data-placement="bottom" title="Danh sách"></span>
                    <br />
                    Email :
            <asp:Label runat="server" ID="lblEmail"></asp:Label>
                </div>
                <!-- ---->
                <div class="col-md-4 noprint" style="padding: 5px 10px; text-align: right;">
                    <b style="margin-right: 10px;">
                        <asp:Label runat="server" ID="lblTime"></asp:Label></b>
                    <span class="btn btn-default" id="btnReply" style="border-radius: 0px; padding: 7px 11px; margin-right: 10px;" data-toggle="tooltip" data-placement="bottom" title="Trả lời">
                        <span class="fa fa-pencil-square-o"></span>
                    </span>
                    <span class="btn btn-default" id="btnForward" style="border-radius: 0px; padding: 7px 11px;" data-toggle="tooltip" data-placement="bottom" title="Chuyển tiếp">
                        <span class="fa fa-mail-reply-all"></span>
                    </span>
                </div>
            </div>
            <div id="content_mail_1" class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 20px;">
                <asp:Label ID="lblContetn" runat="server"></asp:Label>
            </div>
            <div id="attact_file_1" class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 10px; padding-bottom: 0px; border-top: 1px solid #ddd;">
                <asp:Repeater runat="server" ID="rptFiles">
                    <ItemTemplate>
                        <label class='down_attach_file'style="cursor: pointer; padding: 5px 10px;">
                            <A style="font-size:12px;color:#888;text-decoration:none;max-width:100px;white-space: nowrap;overflow:hidden !important;text-overflow: ellipsis;" href='DownloadFile.ashx?file=<%#Eval("filename") %>'><%#System.IO.Path.GetFileName(Server.MapPath(Eval("filename")+"")) %></A> 
                            <i class='fa fa-download' style='margin-left: 10px;'></i></label>
                    </ItemTemplate>
                </asp:Repeater>
            </div>

            <!-- -->
        </div>
    </div>
    <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 0px; margin: 5px; height: 1px; background: #ddd;"></div>
    <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12 noprint" style="padding: 0px;">
        <div class="col-md-1 col-lg-1 hidden-sm hidden-xs" style="padding: 5px;">
            <div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 title_over" style="line-height: 37px; font-weight: bold; font-size: 18px;">
                <img class="img img-thumbnail" runat="server" id="detail_avatar" style="width: 40px;" />
            </div>
        </div>
        <div class="col-md-11 col-xs-12 col-lg-11 col-sm-12" style="padding: 0px;">

            <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12" style="padding: 5px;">
                <div id="tmp_textarea" class="input_add" style="height: 80px; padding: 10px;">
                    Vui lòng Click vào đây để <a class="btnReply" style="cursor: pointer; text-decoration: underline; color: #333;">Trả lời</a> hoặc <a class="btnForward" style="cursor: pointer; color: #333; text-decoration: underline;">Chuyển tiếp</a>.
                </div>
            </div>
            <div class="col-md-12 co-xs-12 col-lg-12 col-sm-12 hidden" id="tmp_textarea_aw" style="padding: 10px 0px;">
                <div class="col-md-12" style="padding: 0px;">
                    <div class="input-group col-md-12 co-xs-12 col-lg-12 col-sm-12" style="border: 1px solid #ddd;">
                        <span id="main_send" class="input-group-addon" style="color: #ccc; background: none; border-radius: 0px; border: 0px; ">Tới :</span>
                        <div id="txtDetailToList" style="float: left;margin-top:5px;"></div>
                        <input id="txtDetailTo" type="text" class="input_add" style="border: 0px;float:left;width:auto !important;">
                        <span class="input-group-addon" onclick="$('#form_CC2').removeClass('hidden');$(this).addClass('hidden');" style="cursor: pointer; color: #ccc; background: none; border-radius: 0px; border: 0px;">CC</span>
                        <span class="input-group-addon" onclick="$('#form_BCC2').removeClass('hidden');$(this).addClass('hidden');" style="cursor: pointer; color: #ccc; background: none; border-radius: 0px; border: 0px;">BCC</span>
                    </div>
                </div>
                <div id="form_CC2" class="hidden input-group col-md-12 col-xs-12 col-sm-12" style="border: 1px solid #ddd; border-top: 0px; padding: 0px;">
                    <span class="input-group-addon" style="color: #ccc; background: none; border-radius: 0px; border: 0px;">CC :</span>
                    <div id="txtDetailCCList" style="float: left"></div>
                    <input id="txtDetailCC" type="text" class="input_add" style="border: 0px;">
                </div>
                <div id="form_BCC2" class="hidden input-group col-md-12 col-xs-12 col-sm-12" style="border: 1px solid #ddd; border-top: 0px; padding: 0px;">
                    <span class="input-group-addon" style="color: #ccc; background: none; border-radius: 0px; border: 0px;">BCC :</span>
                    <div id="txtDetailBccList" style="float: left"></div>
                    <input id="txtDetailBcc" type="text" class="input_add" style="border: 0px;">
                </div>
                <div id="DetailEditor" style="border: 1px solid #ddd; padding: 10px; border-top: 0px;">
                </div>
                <%--<div id="attach_file_view" class="col-md-12 co-xs-12 col-lg-12 col-sm-12" style="padding: 10px; border: 1px solid #ddd; border-top: 0px;">
                </div>--%>
                <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="min-height: 42px;height:auto; padding: 5px; border: 1px solid #ddd; border-top: 0px;">
                    <div id="detail-filelist"></div>
                </div>
                <div class="col-md-12 co-xs-12 col-lg-12 col-sm-12" style="padding: 5px; border: 1px solid #ddd; border-top: 0px;">
                    <div id="DetailToolbar" class="sc-toolbar-container toolbar" style="padding: 0px;">
                        <div class="col-md-12 col-xs-12" style="padding: 0px;">
                            <div class="sc-format-group col-md-12" style="margin-right: 0px; box-sizing: inherit; padding: 0px 0px;">
                                <div class="col-xs-12" style="padding: 5px;">
                                    <span class="sc-bold sc-format-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"></span>
                                    <span class="sc-italic sc-format-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"></span>
                                    <span class="sc-strike sc-format-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"></span>
                                    <span class="sc-underline sc-format-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"></span>
                                    <span class="sc-link sc-format-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"></span>
                                    <span class="sc-format-button" id="uploader-button" style="padding: 8px; border: 1px solid #ddd; border-radius: 0px;"><i class="fa fa-file"></i></span>
                                </div>
                                <div class="pull-left" style="padding: 5px;padding-left:10px;">
                                    <span id="btnDetailSend" class="btn btn-denfault pull-left" style="font-family: Arial; border: 1px solid #d00; border-radius: 0px; background: #d00;padding-right:20px;padding-left:20px; color: #fff; ">Gửi</span>
                                <span style="width:auto;float:left;margin-left:20px;margin-top:6px;line-height:20px;">
                            
                            <input id="radio-input-5" type="radio" value="0" name="radio-group4" checked>
                            <label for="radio-input-5" class="input-helper input-helper--radio" style="font-size: 14px;margin-right:20px; font-weight: normal;">Email cá nhân</label>
                            
                            <input id="radio-input-6" type="radio" value="0" name="radio-group4">
                            <label for="radio-input-6" class="input-helper input-helper--radio" style="font-size: 14px;margin-right:20px; font-weight: normal;">Email nhóm</label>
</span>
                                </div>
                                <div class="pull-right" style="padding: 5px;padding-right:10px;">
                                    <span class="btn btn-denfault pull-right" style="border: 1px solid #ddd; border-radius: 0px; background: #fff;padding-left:10px;padding-right:10px;" id="clearclick2"><i class="fa fa-trash-o" style="color: #333;"></i></span>
                                </div>
                                <form action="javascript:void(0);">
                                    <input type="file" id="file-chooser" style="display: none;" name="f" multiple="multiple"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        jQuery(function () {
            function getQueryStrings() {
                var assoc = {};
                var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); };
                var queryString = location.search.substring(1);
                var keyValues = queryString.split('&');

                for (var i in keyValues) {
                    var key = keyValues[i].split('=');
                    if (key.length > 1) {
                        assoc[decode(key[0])] = decode(key[1]);
                    }
                }

                return assoc;
            }
            $(document).on('click', '#btnBack', function (event) {
                parent.history.back();
            });

            var qs = getQueryStrings();
            var id = qs["id"];
            var mode = qs["mode"];
            $(document).on('click', '#btnDetail_Del', function (event) {
                var url = "details.aspx/delete";
                $.ajax({
                    type: "POST",
                    url: url,
                    data: "{id:"+id+",mode:'" + mode + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        alert('Xoá thành công!');
                        parent.history.back();
                    },
                    error: function (jqXHR, textStatus, errorThrown) {
                        // Handle errors here
                        console.log('ERRORS: ' + textStatus);
                        alert("submit fail" + errorThrown);
                        // STOP LOADING SPINNER
                    }
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="SmartPhoneLeft">
    <div class="col-xs-12" style="width: 100%; padding: 5px 0px; text-align: center;">
        <div class="col-xs-12" style="padding: 5px 0px; text-align: center;">

            <div class="col-xs-3" style="padding: 5px; text-align: right;">
                <img class="img-circle img img-thumbnail dropdown-toggle" data-toggle="dropdown" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c6.0.160.160/p160x160/10450596_545002008956679_2387905694320684413_n.jpg" style="width: 100%;" />
                <div class="dropdown-menu" style="width: 300px; left: 0px !important; padding: 10px;">
                    <div class="col-xs-12" style="padding: 0px;">
                        <div class="col-xs-4" style="padding: 0px;">
                            <img class="img" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c6.0.160.160/p160x160/10450596_545002008956679_2387905694320684413_n.jpg" style="width: 100%;" />
                        </div>
                        <div class="col-xs-8" style="padding: 4px 20px;">
                            <p style="font-size: 16px;">
                                <b style="font-size: 14px;">Yas Jek</b><br />
                                yas.jek@gmail.com
                            </p>
                            <p style="margin: 0px;">
                                <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="window.open('Profile.aspx','_self');">Thông tin</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-xs-12" style="padding: 0px;">
                        <div class="col-xs-6" style="padding: 7px 5px 0px 0px; line-height: 34px;">
                            <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="window.open('Setting.aspx','_self');">Cài đặt</span>
                        </div>
                        <div class="col-xs-6" style="padding: 7px 0px 0px 5px; line-height: 34px;">
                            <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="window.open('Logout.aspx','_self');">Đăng xuất</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-7" style="padding: 5px;">
                <div class="col-xs-12" style="padding: 0px; font-weight: bold; text-align: center;">
                    <span class="visible-xs noprint" style="line-height: 26px; color: #555;">bthehien@gmail.com</span>
                </div>
            </div>
            <div class="col-xs-2" style="padding: 0px;">
                <span class="menu-anchor visible-xs pull-right noprint" style="border: 1px solid #ddd; margin: 10px;"></span>
            </div>
        </div>
    </div>
    <hr />
    <div class="col-xs-12 menu_left" style="padding: 0px;">
        <ul>
            <li class="active"><a href="default.aspx">Hộp thư đến (2)</a></li>
            <li><a href="#">Thư đã gửi</a></li>
            <li><a href="#">Hộp thư Spam</a></li>
            <li><a href="#">Thư nháp</a></li>
            <li><a href="#">Thùng rác</a></li>
        </ul>
    </div>
</asp:Content>
